import {
	createRouter,
	createWebHashHistory
} from 'vue-router'
import VueCookies from 'vue-cookies'

const routes = [{
		// 匹配所有路径  vue2使用*   vue3使用/:pathMatch(.*)*或/:pathMatch(.*)或/:catchAll(.*)
		path: "/:pathMatch(.*)*",
		name: "home",
		component: () => import('../views/Home.vue')
	},
	{
		path: '/login',
		component: () => import('../views/Login.vue')
	},
	{
		path: '/home',
		component: () => import('../views/Home.vue')
	},
	{
		path: '/personal',
		component: () => import('../views/Personal.vue')
	},
	{
		path: '/usedcar/add',
		component: () => import('../views/page/Add.vue')
	},
	{
		path: '/usedcar/update',
		component: () => import('../views/page/Update.vue')
	},
	{
		path: '/usedcar/detail',
		component: () => import('../views/page/UsedarDetail.vue')
	}
]

const router = createRouter({
	history: createWebHashHistory(),
	routes
})

export default router
